<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('Activity/index')}">活动管理</a></li>
            <li><a href="{:U('Activity/add')}" target="_self">添加活动</a></li>
        </ul>
        <form class="well form-search" method="post" action="{:U('Activity/index')}">
            分类：
            <select class="select_2" name="event_type">
                <option value='0'>全部</option>
                <foreach name="eventTypeList" item="vo">
                    <option <if condition="(I('param.event_type') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select> &nbsp;&nbsp;
            时间：
            <input type="text" name="start_time" class="js-date" value="{:I('param.start_time')}" style="width: 80px;" autocomplete="off">-
            <input type="text" name="end_time" class="js-date"  value="{:I('param.end_time')}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
            标题：
            <input type="text" name="keyword" style="width: 200px;" value="{:I('param.keyword')}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
        </form>
		<table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>活动名称</th>
                    <th>活动类型 - 状态</th>
                    <th>开始 - 结束</th>
                        <th>状态</th>
                    <th>最后操作人</th>
                    <th width="110">操作</th>
                </tr>
            </thead>
            <foreach name="events" item="vo">
                <tr>
                    <td>{$vo.event_name}</td>
                    <td>{$eventTypeList[$vo['event_type']-1]['name']} - {$eventStatusList[$vo['event_status']-1]['name']}</td>
                    <td>{$vo.start_at} - {$vo.end_at}</td>
                    <td>
						<if condition="$vo['start_at'] gt date('Y-m-d H:i:s')">
			        		<b>未开始</b>
						<elseif condition="$vo['start_at'] lt date('Y-m-d H:i:s') && $vo['end_at'] gt date('Y-m-d H:i:s')"/>
			        		<b style="color: red;">活动中</b>
		        		<else />
			        		已结束
						</if>
                    </td>
                    <td><foreach name="users" item="user"><if condition="$vo['created_by'] eq $user['id']">{$user.user_login}</if></foreach></td>
                    <td>
					<if condition="$vo['event_status'] eq 1">
						<a href="{:U('Activity/up',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要上线此活动吗？">待审核</a> |
					</if>
					<if condition="$vo['event_status'] eq 2">
						<a href="{:U('Activity/down',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要下线此活动吗？" style="color: #FF0000;"><b>已上线</b> </a> |
					</if>
					<if condition="$vo['event_status'] eq 3">
						<a href="{:U('Activity/up',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要上线此活动吗？">已下线</a> |
					</if>
                      <a href="{:U('Activity/edit', array('id'=>$vo['id']))}">{:L('EDIT')}</a> |
					  <a href="{:U('Activity/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            <thead>
                <tr>
                    <th>活动名称</th>
                    <th>活动类型 - 状态</th>
                    <th>开始 - 结束</th>
                        <th>状态</th>
                    <th>最后操作人</th>
                    <th width="110">操作</th>
                </tr>
            </thead>
        </table>

        <div class="pagination">{$Page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
